package com.lupan.guice.bindings.providesMethods;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.lupan.guice.bindings.CreditCardProcessor;
import com.lupan.guice.bindings.DatabaseTransactionLog;
import com.lupan.guice.bindings.PaypalCreditCardProcessor;
import com.lupan.guice.bindings.TransactionLog;
import com.lupan.guice.bindings.bindingAnnotations.Paypal;

/**
 * 说明：
 *
 * @author lupan
 * @version 2016/10/8 11:22
 */
public class ProvidesMethodModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(CreditCardProcessor.class).to(PaypalCreditCardProcessor.class);
    }

    @Provides @Paypal
    TransactionLog getLog(){
        DatabaseTransactionLog log = new DatabaseTransactionLog();
        log.setJdbcUrl("jdbc:sqlserver://10.101.37.195:1433;databaseName=bscati");
        log.setMaxPoolSize(10);
        return log;
    }
}
